Skip to content

entry for wiener diffusion model#934

Merged
bob-carpenter merged 13 commits into
stan-dev:masterfrom
Franzi2114:feature/docs_for_wiener_lpdf_and_lcdf_unnorm
May 18, 2026
Merged

entry for wiener diffusion model#934
bob-carpenter merged 13 commits into
stan-dev:masterfrom
Franzi2114:feature/docs_for_wiener_lpdf_and_lcdf_unnorm

Conversation

@Franzi2114
Copy link
Copy Markdown
Contributor

Summary

This PR adds a user's guide entry for the wiener diffusion model. It is linked to the PRs for the seven parameter diffusion model PDF and CDF functions
stan-dev/math#2822
stan-dev/math#3042

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

Franziska Henrich

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@bob-carpenter
Copy link
Copy Markdown
Member

Thanks, so much, @Franzi2114. If nobody else can get to this, I can review it some time over the next week.

@Franzi2114
Copy link
Copy Markdown
Contributor Author

Perfec,t thanks @bob-carpenter! I was also in contact with @WardBrian before I did the PR.

There are still three open points that I didn't manage to incorporate:

  • The citations did not work locally although I added the entries in the bib file
  • I would prefer to include the .pdf version instead of the .jpeg version of the image as it has much higher quality
  • and there could be inserted a link to another subchapter of the User’s guide.

Please let me know when there occur more points that I should change.

@WardBrian WardBrian requested a review from bob-carpenter March 12, 2026 11:12
@WardBrian
Copy link
Copy Markdown
Member

Hi @Franzi2114 --

I've just pushed a commit that addresses each of your comments, since they're mostly quarto-wrangling:

  • The citations issue seems to have just been a small typo.
  • Quarto supports multi-format figures, so as it is currently written the website will use the JPG and the pdf manual will use the PDF. If you have a higher-quality raster image (png, nicer jpg, etc) we can use that on the web version instead
  • I added the link and made sure that this new chapter shows up on the sidebar.

@WardBrian
Copy link
Copy Markdown
Member

Pinging @bob-carpenter again -- I think the notifications for this got lost while you were away

@bob-carpenter
Copy link
Copy Markdown
Member

Thanks for pinging. I will review this week.

Copy link
Copy Markdown
Member

@bob-carpenter bob-carpenter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Franzi:

I'm really sorry this is so many comments. Most of it's to try to get consistency with the rest of our documentation's formatting.

The most important comment is about the upper bounds for parameters that are missing from the examples.

If you'd rather not make the fixes yourself, I think I can go through and make almost all of them other than places where I had genuine questions.

Comment thread src/bibtex/all.bib Outdated
Comment thread src/bibtex/all.bib Outdated
Comment thread src/bibtex/all.bib Outdated
Comment thread src/bibtex/all.bib Outdated
Comment thread src/bibtex/all.bib Outdated
Comment thread src/stan-users-guide/wiener_diffusion_model.qmd Outdated
Comment thread src/stan-users-guide/wiener_diffusion_model.qmd
Comment thread src/stan-users-guide/wiener_diffusion_model.qmd Outdated
Comment thread src/stan-users-guide/wiener_diffusion_model.qmd Outdated
Comment thread src/stan-users-guide/wiener_diffusion_model.qmd
@Franzi2114
Copy link
Copy Markdown
Contributor Author

Dear @bob-carpenter, I worked through all your comments and made several changes!

Could you have another look at it? I also had some questions regarding your posts. I wrote them below your comments.

I am afraid that I messed something up with the all.bib file. Can you fix this?

@bob-carpenter
Copy link
Copy Markdown
Member

bob-carpenter commented May 18, 2026

There are also conflicts with character usage of unicode ~ when you try to build. Do all the docs build locally for you with the broken all.bib file and the stray unicode characters?

It looks somehow like you dumped in an entirely conflicting bibtex file somehow. To fix, you just need to get rid of all the notes about conflicts that were autogenerated in all.bib and leave just what should be there, then push. I can do that locally.

I'll just go ahead and make the language changes and indicate what I did above. The main issue is that likelihoods are functions of parameters, not data, by construction.

@bob-carpenter
Copy link
Copy Markdown
Member

There are non-ASCII versions of ~ on several lines. That won't render in LaTeX. I just switched it back to ASCII.

stan-users-guide (feature/docs_for_wiener_lpdf_and_lcdf_unnorm)$ grep -rn $'\xe2\x88\xbc' *.qmd

wiener_diffusion_model.qmd:127:  a ∼ normal(1, 1);
wiener_diffusion_model.qmd:128:  w ∼ normal(0.5, 0.1);
wiener_diffusion_model.qmd:129:  v ∼ normal(2, 3);
wiener_diffusion_model.qmd:130:  t0 ∼ normal(0.435, 0.12);
wiener_diffusion_model.qmd:132:  sv ∼ normal(1, 3);
wiener_diffusion_model.qmd:133:  st0 ∼ normal(0.183, 0.09);
wiener_diffusion_model.qmd:134:  sw ∼ beta(1, 3);
wiener_diffusion_model.qmd:384:        y[i] ∼ wiener(a, t0, w, v, sv, sw, st0);
wiener_diffusion_model.qmd:388:        y[i] ∼ wiener(a, t0, one_minus_w, neg_v, sv, sw, st0);

I don't actually see any conflicts in the all.bib file on the branch.

I went through and cut lines down to 80 characters. I also spaced out operators, etc. in code and tightened spaces to conform to our coding guidelines (appendix of user's guide). I also removed the "end" block and other comments on lines with braces and moved them down so the structure of the code is clearer.

Italic words shouldn't be in formulas like $lik_i$---it needs to be $\textit{lik}_i$ so that "lik" is typeset like text rather than like math, the latter of which tends to insert odd spacing based on its guess as to what's a function and argument.

@bob-carpenter
Copy link
Copy Markdown
Member

I just went ahead and converted the figure to a .png and made that the default format for the web page.

I just realized in doing a diff on the command line that the conflict with the .bib file is that it got Windows-style newlines. We strictly use Unix/Linux/Mac newlines. Windows should not have tried to innovate on the newline character! I switched it back using dos2unix.

It all builds now and I checked the output in html and pdf and the images look right.

Thanks for bearing with the long process here. It only took me an hour or so to put in the final patches.

Copy link
Copy Markdown
Member

@bob-carpenter bob-carpenter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for all the updates.

@bob-carpenter bob-carpenter merged commit 78e7df3 into stan-dev:master May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants